package com.kongshidian.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.kongshidian.R;
import com.kongshidian.bean.Product;
import com.kongshidian.ui.view.AbsViewHolderAdapter;
import com.nostra13.universalimageloader.core.ImageLoader;


/** 单品推荐 adapter */
public class MainProductRecommendAdapter extends AbsViewHolderAdapter<Product>{

	public MainProductRecommendAdapter(Context context, int layoutRes) {
		super(context, layoutRes);
	}

	@Override
	protected void bindData(int pos, Product itemData) {
		ImageView mImage = getViewFromHolder(R.id.item_main_product_recommend_image);
		TextView mText = getViewFromHolder(R.id.item_main_product_recommend_name_txt);
		TextView mText1 = getViewFromHolder(R.id.item_item_main_product_recommend_price_txt);

		ImageLoader.getInstance().displayImage(itemData.getImage(), mImage);
		mText.setText(itemData.getName());
		mText1.setText("￥"+itemData.getPrice()+"");
	}

}
